﻿<UserControl x:Class="DirectoryAnalyzer.Controls.GraphToggleButton"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:ViewModels="clr-namespace:DirectoryAnalyzer.Controls.ViewModels"
             mc:Ignorable="d" Height="23" 
             d:DesignHeight="23" d:DesignWidth="100">

    <Grid Name="MainContent">
        <Grid.Resources>
            <ViewModels:ToggleButtonViewModel x:Key="ToggleButtonVM" />
        </Grid.Resources>

        <ToggleButton Name="tglToggleButton" DataContext="{StaticResource ToggleButtonVM}" 
                      IsChecked="{Binding IsToggleChecked}" Height="23" 
                      HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                      HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center" 
                      Checked="tglToggleButton_CheckedStateChanged" Unchecked="tglToggleButton_CheckedStateChanged" 
                      Click="tglToggleButton_CheckedStateChanged"
                      MouseEnter="tglToggleButton_MouseEnter" MouseLeave="tglToggleButton_MouseLeave">
            <Grid Name="grdToggleBody" Margin="1,1,1,-1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="30" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Image Name="imgDisplayGraph" HorizontalAlignment="Stretch" VerticalAlignment="Center" 
                       Stretch="Uniform" Source="../Images/pie.png" />
                <!--{Binding GraphImageSource}-->
                <!-- ../Images/pie.png -->
                <TextBlock Name="txtToggleText" Grid.Column="1" FontStretch="SemiExpanded" Text="{Binding ToggleButtonText}" 
                           HorizontalAlignment="Center" VerticalAlignment="Center" />
            </Grid>
        </ToggleButton>
    </Grid>
</UserControl>
